/*
 * Created on Jul 17, 2005
 *
 */
package org.mushroomdb.interceptor;

import org.mushroomdb.catalog.Register;
import org.mushroomdb.catalog.Table;

/**
 * This is the main interface for interceptor objects.
 * Additional events can be added by extending this interface.
 * 
 * @author Matu
 *
 */
public interface Interceptor {

	/** CREATE OPERATIONS */
	
	void beforeCreate(Table table);
	
	void afterCreate(Table table);
	
	void createException(Table table, Throwable t);
	
	/** DROP OPERATIONS */
	
	void beforeDrop(Table table);
	
	void afterDrop(Table table);
	
	void dropException(Table table, Throwable t);
	
	/** SELECT OPERATIONS */
	
	void beforeSelect(Table table);
	
	void afterSelect(Table table);
	
	void selectException(Table table, Throwable t);
	
	/** INSERT OPERATIONS */
	
	void beforeInsert(Register register, Table table);
	
	void afterInsert(Register register, Table table);
	
	void insertException(Register register, Table table, Throwable t);
	
	/** UPDATE OPERATIONS */
	
	void beforeUpdate(Register register, int columnIndex, Object object, Table table);
	
	void afterUpdate(Register register, int columnIndex, Object object, Table table);
	
	void updateException(Register register, int columnIndex, Object object, Table table, Throwable t);
	
	/** DELETE OPERATIONS */
	
	void beforeDelete(Register register, Table table);
	
	void afterDelete(Register register, Table table);
	
	void deleteException(Register register, Table table, Throwable t);
   
    void beforeCommit();
   
    void afterCommit();

}
